{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.【填空】如下代码的运行结果为：（ ）。\n",
    "```\n",
    "import numpy as np  \n",
    "np.arange(1,20,4) ```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：array([ 1,  5,  9, 13, 17])。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.【填空】如下代码的运行结果为：（）。\n",
    "```\n",
    "import numpy as np  \n",
    "myArray2=np.arange(1,22).reshape([3,7])\n",
    "myArray2[[0,2],3]```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：array([ 4, 18])。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.【填空】如下代码的运行结果为：（）。\n",
    "```\n",
    "import numpy as np\n",
    "myArray1=np.array(range(5,15))\n",
    "myArray2=myArray1.copy()\n",
    "myArray2[1]=1\n",
    "myArray3=myArray2\n",
    "myArray3[2]=2\n",
    "print(myArray1)\n",
    "print(myArray2)\n",
    "print(myArray3)```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：  \n",
    "[ 5  6  7  8  9 10 11 12 13 14]   \n",
    "[ 5  1  2  8  9 10 11 12 13 14]   \n",
    "[ 5  1  2  8  9 10 11 12 13 14]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.【填空】如下代码的运行结果为：（ ）。  \n",
    "```\n",
    "import numpy as np  \n",
    "myArray1=np.arange(1,11).reshape([2,5])\n",
    "myArray2=np.arange(-11,-1).reshape([2,5])\n",
    "np.add(myArray1,myArray2)```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：  \n",
    "```array([[-10,  -8,  -6,  -4,  -2],\n",
    "       [  0,   2,   4,   6,   8]])```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.【填空】如下代码的运行结果为：（ ）。  \n",
    "```\n",
    "import numpy as np  \n",
    "myArray1=np.arange(1,11).reshape([2,5])\n",
    "myArray2=np.delete(myArray1,0,0)\n",
    "np.delete(myArray2,1,1)```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：array([[ 6,  8,  9, 10]])。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.【判断】在查看数组形状或进行重构时，方法reshape()、swapaxes(0,1)不会改变数组本身，而resize()、astype()更改数组本身。（ ）  \n",
    "\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.【判断】array1+array2时，若两者行数或列数不一样，则解释器将报ValueError错误。（ ）  \n",
    "\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "8.【判断】执行如下程序后，将产生如下输出结果。（ ）\n",
    "```\n",
    "import numpy as np  \n",
    "MyArray=np.array([[3,6,9,12],\n",
    "                  [2,5,8,11],\n",
    "                  [1,4,7,10]])\n",
    "np.sort(MyArray,axis=0)\n",
    "MyArray```\n",
    "程序运行结果：\n",
    "\n",
    "```\n",
    "array([[ 1,  4,  7, 10],\n",
    "       [ 2,  5,  8, 11],\n",
    "       [ 3,  6,  9, 12]])```\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B。  \n",
    "解析：MyArray本身并未被改变。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
